<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./js/utils.js?46"></script>
    <link rel="stylesheet" href="./css.css" type="text/css" />
    <title>Login</title>
</head>

<body>
    <!-- <a @Link="/routeb">Go to routeb</a> -->
    <div class="login" calo>
        <div id="logo"></div>
        <input placeholder="username" @field="user" type="text" />
        <input @field="pass" type="text" />
        <button @Click="login">login</button>
        <a href='javascript:window.open("https://economic-debt.surge.sh/")'>Surge</a>
        <a href="resolver.html" target="_blank">id</a>
        <script>
            var calo = {
                router: {},
                model: {
                    user: 'calo',
                    pass: '123'
                },
                login: function() {
                    const payload = this.model
                    this.ajax({
                        url: getApiByName("login"),
                        data: payload,
                        success: function(data) {
                            console.log(data)
                            this.model.user = data.ok
                            if (data.ok === true) {
                                redirect('./main.html')
                                    // this.navigate('/routec?id=66')
                            }
                        }
                    })
                }
            }
        </script>

    </div>
    <script>
        require('./js/calo.js?45')
        whenready(function() {
            calo.makePlugin('logo', pluginLogo)
            console.log(window.screen.availHeight, "|", window.screen.height)
        })
    </script>

</body>

</html>